﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FleetCode.Model
{
    [Serializable]
    public class Root
    {
        public int version => 3;
        public Fleet f1 { get; set; }
        public Fleet f2 { get; set; }
        public Fleet f3 { get; set; }
        public Fleet f4 { get; set; }

        public static Root Convert(IEnumerable<Grabacr07.KanColleWrapper.Models.Fleet> fleets)
        {
            return new Root
            {
                f1 = new Fleet(fleets.FirstOrDefault()),
                f2 = new Fleet(fleets.Skip(1).FirstOrDefault()),
                f3 = new Fleet(fleets.Skip(2).FirstOrDefault()),
                f4 = new Fleet(fleets.Skip(3).FirstOrDefault())
            };
        }
    }
}
